from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView
from django.urls import path, re_path
from users.views import loginSmsViews, LoginSmsApiView, RegisterSmsApiView, RegisterViews, MobileViews, \
                        ForgetPwdSmsApiView, ResetPwdViews, ForgetPwdView


urlpatterns = [
    # 获取Token
    path('jwt/access/', TokenObtainPairView.as_view()),
    # 刷新Token
    path('jwt/refresh/', TokenRefreshView.as_view()),
    # 校验Token
    path('jwt/verify/', TokenVerifyView.as_view()),
    # 手机号验证码登录
    path('loginSms/', loginSmsViews.as_view()),
    # 登录容联云短信发送
    re_path(r'^login_sendsms/(?P<mobile>1[3-9]\d{9})/$', LoginSmsApiView.as_view()),
    # 注册容联云短信发送
    re_path(r'^register_sendsms/(?P<mobile>1[3-9]\d{9})/$', RegisterSmsApiView.as_view()),
    # 找回密码容联云短信发送
    re_path(r'^forgetPwd_sendsms/(?P<mobile>1[3-9]\d{9})/$', ForgetPwdSmsApiView.as_view()),
    # 手机号唯一注册
    re_path(r'^mobile/(?P<mobile>1[3-9]\d{9})/$', MobileViews.as_view()),
    # 手机号注册
    path('register/', RegisterViews.as_view()),
    # 找回密码
    path('forget/', ForgetPwdView.as_view()),
    # 重置密码
    path('reset/', ResetPwdViews.as_view()),
]
